home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
new_file
/
extras
/
atarivew
/
docs
/
techman.doc
< prev
Wrap
Text File
|
1991-05-26
|
30KB
|
834 lines
063010303010000126002006006002000
1AtariView V1.031
2Page #1
F0110030001
9[.............................................................]1010
ÇAtariView1.10
Atari-ST
WrittenbyTonyHoyle
*Thisisthetechnicalmanual.ForuserinformationseeATARIVIEW.DOC*
9[...............................................................................................]2010
ÇêModuleHeaders
Ç
Eachmoduleisastandardrelocatablefilewiththefollowinginthefirstfew
bytesoftheprogram:
$0 DC.W$ABCD VTOSModuleidentification.
$2 DC.LSetup Programinitialisationaddressor0.
$6 DC.LMenu AddressofMenuoptionassociatedwiththismodule.
$A DC.LNext Modulechain-canbeusedtoputmorethanonemodule
intoafile(Zeroifnomore).
TheModuleIDmustbeaconstantasGEMwillnotrelocateaprogramwhichhas
arelocatablevalueinitsfirstword.
Modulesareenteredinusermode,althoughthereisnorestrictionplacedupon
usingsupervisormode.
Thebasepageforeachmoduleisnotcreated,andmodulesmustnotattemptto
re-allocatespacetoGEM.Spacemaybeallocatedbycreatingmemoryblocksif
needed.
êMenuStructure
Ç
The'DrawMenu'routineiscalledwiththeaddressofalistoflongwords.
EachlongwordpointstoaMenustring,asdetailedbelow.Inaddition,the
firstwordofthelististhenumberofMenuoptions,andthenextLongwordis
theaddressoftheTitlestring(whichisjustthestringterminatedbya
null).
EachMenuentrycontains3portions-Astatusbyte,AnAddress,andthemenu
string.Thisisinthefollowingformat:
DC.Bstatus,'MenuText'
DC.Laddress
Thefirstbyteoftheaddress(always0)istakenastheEndofthestring,
thereforethemenutextmustalwaysbeanoddnumberofbyteslongotherwisea
buserrorwillresult.
Thestatusbyteisbitsignificant,asfollows:
Bit0 Setiftheoptionisselectable(ie.Enabled).
Bit1 Setifclickingonthisopioncausesexecution,resetifitcauses
anothermenutobedisplayed.
Theaddresseitherpointstothenextmenuparametertable,ortheexecution
addressoftheoption,dependingonthestatusofbit1.
êInputRoutine
Ç
Thisiscalledjustbeforethekeyboardisscannedduring'GetString'.Itis
intendedtobeusedbythecallingroutinetomonitormouseinteraction(An
exampleofitsuseisinthefileselector).
Input: A0=Pointertonextcharacterininputstring.
Ç D1=Currentlengthofinputstring.
D2=Maximumlengthofinputstring.
D3=Lastcharactercodeentered.
Output: D0=0,Nospecialactionneeded.
1,AbandontheinputasifRightMousepressed.
2,TerminateasifReturnpressed.
3,Redisplaytheinputstringandrestartinput.
êTopLineArrayStructure
Ç
Thetop-lineaddresspassedtofunction28pointstoanarrayoffairlysimple
data,butthismustbedefinedcorrectlyoracrashmeresult.
TheArrayisdefinedasfollows:
TopLine.40 40characterlineofASCII.
Number.b AbytedefiningthenumberofPDMsonthistopline.
Unused.b Thisbytemustbezero.
Pointers.l LongwordspointingtoeachofthePDMsinorder.
EachPDM(PullDownMenu)isdefinedasfollows:
Offset.w Theoffsetincharactersfromtheleftedgeofthescreenof
thisPDM.
OptionEnd.w CharacterpositionoftherightedgeofthePDMoption.
Depth.w ThedepthofthePDMinlines(alsothenumberofoptions).
Width.w ThewidthofthePDMincharacters.
Options Eachoptionstringinorder,terminatedbyanullandprefixed
byabytewhichdefineswhethertheoptionisactiveornot
(1=Off,2=On).
êResponseframeControlarrays
Ç
ThesearraysdefinetheactionoftheResponseFramehandlerupontheframe
passedtoit.Youcandefineflexiblyanynumberoffieldsandmousebuttons
accordingtorequirements.
TheArrayisanullterminatedlistofentrieswhichmaybeofoneoftwo
types.Detailsofeachtypeareasfollows:
FieldEntry:
DC.B'F',fieldtype
DC.WXposition *Xpositionoffield
DC.WYposition *Ypositionoffield
DC.WLength *Lengthoffield
DC.LCharList *Characterlistfortype2fields.
MouseEntry:
DC.B'M',mousetype
DC.WXposition *Xpositionofbutton
DC.WYposition *Ypositionofbutton
DC.WLength *Lengthofbuttontext
Ç DC.LRoutine *Routineaddressfortype2buttons.
ErrorEntry:
DC.B'E',0
DC.WXposition *Xpositionofcontrolcode(seebelow)
DC.WYposition *Ypositionofcontrolcode(seebelow)
DC.W0 *Reserved-Specifyaszero
DC.L0 *Reserved-Specifyaszero
'fieldtype'=0meansanycharactermaybeputintothefield.
=1meansonlydigitsmaybeputintothefield
=2meansonlycharactersdefinedinthecharacterlistmaybeput
intothefield.
+$40meansthefieldmustnotbeempty.
+$80meandthefieldmustbefull.
'mousetype'=0meansthisisanOKButton.
=1meansthisisaCancelButton.
=2means'Routine'iscalledeverytimethisbuttonisclicked.
êErrorEntriesÇ
Eacherrorentrypointstoonesquare,whichwillbeinitialisedto1(Red
ink)or0(Blackink)beforetheframeisdisplayed,dependingontherelevent
bitofd7suppliedwhen'DoResponse'iscalled.
êDefiningMemoryBlocks
Ç
Allmemoryblockshaveastandardformatheaderasfollows:
$00 DC.LLength Lengthofdata+24forheader.
$04 DS.B16 Nameofblock
$14 DC.WType Typeofblock(bitsignificant).
Framesareoftype$0001($0003iftheyincluderoutes).Templatesareof
type$0100,andmostsystemblocksareoftype$8000(Thephoneandmailbox
directoriesarestoredasblocks).
Aframeisdefinedasfollows:
$16 DC.WPages Numberofpagesstored
$18....(Foreachpage)
DS.B960 Theframe.
(Alsoiftheframecontainsroutes)
DS.B9 Pagenumber.
DS.B1 FrameID.
DS.B1 UserAccess(YorN).
DS.B5 CUGNumber.
DS.B8 Unused(ProductnumberonPrestel-notuploaded).
Ç DS.B6 Pricein10ths/p.
DS.B9*10 Choicesforkeys0..9.
DS.B1 FrameType.
DS.B1 UpdateOption.
AllentriesareinthesameformatasrequiredforPrestelBulkUpdate.
9[..................................................................]1010
ÇêVTOSsystemvariables(BasepassedinA1oninitialisation)
Ç
Offset Name Purpose
0000 Xposition.w CursorXposition
0002 Yposition.w CursorYposition
0004 ScreenBuffer.l Baseofviewdatascreen
0008 MouseFlags.b MouseFlagsregister(seebelow)
0009 CurFlags.b Cursorandrevealflags(seebelow)
000A Flags.b Characterstateflags(seebelow)
000B Colours.b Background/Foregroundcolours
000C LastGraph.b Lastgraphiccharacterdisplayed
000D Speed.b RS232Transmitspeed
000E RSBits.b Numberofbits(7or8)
000F RSParity.b Parity(0=None,1=Odd,2=Even)
0010 RSStop.b Numberofstopbits
0011 RSFlags.b RS232statusflags(seebelow)
0012 MouseX.w MouseXposition
0014 MouseY.w MouseYposition
0016 BaseOfFree.l Baseofmemory
001A TopOfFree.l Topofmemory
001E CurrentBase.l Currentbaseoffreememory
0022 MouseVector.l Routinecalledonmousebuttonevent
0026 Button.b Mousebuttonstatus
0027 SysFlags.b Systemflags-notuseralterable
0028 ScreenBase.l Baseofdisplayedscreen
002C CursorAddr.l Addressofcursorcharacter
0030 CursorAddr2.l Cursorforshadowscreen
0034 ShadowScreenP.l Baseofshadowscreen
0038 Char.w RS23275baudcharacter(10/11bit)
003A Timer.w RS23275baudtimer
003C GraphBuff.l 4bytegraphiccharacterbuffer
0040 CursorStore.8 8bytecursorbackgroundstore
0048 CursorStore2.8 Storeforshadowscreen
0050 Unused.8 Unused8bytebuffer
0058 DoubleList.24 24lineDoubleHeightcounter
0070 FlashList.8 8byteflashingcolourlist
0078 NextFlash.b Nextflashcharactertobeused
0079 FlashLength.b Currentlengthofflashlist
ł007A ModuleCount.b Numberofmodulesinthesystem
007B FlashOnRate.b Flashonperiod
007C FlashOffRate.b Flashoffperiod
007D CursorRate.b Cursorflashrate
007E CursorCount.b Cursorflashratecounter
007F FlashCount.b Flashratecounter
0080 LastInk.b Temporaryinkcolourstore
0081 BuffLen.b Lengthof75baudTxCharacter
0082 CharVec.l Backgroundmodecharacterhandler
0086 CallTimer.w Secondsperchargeableunit(*100)
008A UnitPrice.l Priceperunitin100ths/p
008E CurrentPrice.l Priceofcurrentcallin100ths/p
0092 SecondCount.b Vblanksuntilnextsecond
0093 ScreenFlags.b Flagscontrollingscreenmode(seebelow)
0094 Identity.l Pointertologinstring(clearedafteruse)
0098 InpVector.l Addressofroutinecalledduring'GetString'
009C KMacro.l Addressofkeyboardmacrostring
00A0 Year.B BCDYearatlastenquiry
00A1 Month.B BCDMonthatlastenquiry
00A2 Day.B BCDDayatlastenquiry
00A3 Hour.B BCDHouratlastenquiry
00A4 Minute.B BCDMinuteatlastenquiry
00A5 Second.B BCDSecondatlastenquiry(instepsof2)
00A6 Today.B Dayofweek(0=Saturday,2=Monday,6=Friday)
ê'Flags'-Characterflagregister
Ç
Bit Purpose
0 SetwhenESC(27)hasbeensent.Resetautomatically.
1 SetwhenGraphicsmodeison.
2 SetwhenHoldGraphicsison.
3 SetwhenConcealmodeison.
4 SetwhenDoubleHeightison.
5 SetwhenFlashmodeison.
6 SetwhenSeparatedgraphicsison.
7 Temporarygraphicsflag(alwayszero).
ê'CurFlags'-Cursorflagregister
Ç
Bit Purpose
0 Setifthecursorisenabled.
1 SetwhenthescreenisRevealed.
2 Setwhenthecursorisactuallyonthescreen.
3 Interruptlockregister-setbeforewritingtothescreen.
4 Cursorflashingregister-usedbyinterrupt.
5 Characterflashingregister-usedbyinterrupt.
6 Setiftheinksneedupdating.
≤Çê'MouseFlags'-Mouseflagregister
Ç
Bit Purpose
0 Setifthemouseisenabled.
1 Resetifthemouseisonthescreen.
2 SettodrawthemousenextVblank.
3 SetifMultiflashisenabled.
4 Ifresetincomingcharactersaredealtwithinthebackground.
5 Ifsetthisscreenmayberevealed(eg.Bufferisvalid).
6 Notused.
7 IfsetbottomlinewillberedisplayednextVblank.
ê'RSFlags'-RS232statusregister
Ç
Bit Purpose
0 DCD(Datacarrierdetect)
1 CTS(Cleartosend)
ê'ScreenFlags'-Screencontrolflags
Ç
Bit Purpose
0 Ifsetthescreenisdisplayedinblackandwhite.
1 Ifsetthescreenscrollsinsteadofwrappingtothetop.
2 Setwhenthemouseisclickedonthetopline.
3 SettoignoreanyDoubleHeightcharacters(usedforPDMs).
ÇêCallingConventions
Ç
VTOSisaccessedthroughatableofaddress,thebaseofwhichispassedin
registerA0whenamoduleisinitialised.RegisterA1pointstotheVTOS
systemvariables.
TheGEMVDIandAEScallscannotbeusedwhenVTOSisresident.Inaddition,
theGEMmouseisnotusedsomouserelatedA-Linecallswillnotwork.
êVTOSCalls
Ç
ü0:High-Levelcharacterdisplay(Offset0).Ç
Input: D0.B=Charactertodisplayonthescreen.
Output: None.
AllControlcodesarefiltered,Escapecodesareexpandedandthescreen
bufferisupdated.Colourcodescausethescreentoberefreshed.All
registersarepreservedbythiscall.
ü1:Low-Levelcharacterdisplay(Offset4).Ç
Input: D0.B=Charactertodisplayinthescreen.
Output: None.
Characters0..31aretreatedasescapecodes.Thecharacterisnotputinto
thescreenbuffer.
ü2:RecievecharacterfromRS232(Offset8).Ç
Input: None.
Output: D0.Wsettorecievedcharacter,or-1ifnone.
ThisroutinemustbeusedratherthantheGEMDOSroutine.
ü3:SendcharactertoRS232(Offset12).Ç
Input: D0.B=Charactertosend.
Output: None.
UseinsteadoftheGEMDOSroutine.Thisroutinehandles1200/75baud
correctly,butignoresthestateofRTSorCTS.
±ü4:ConfigureRS232(Offset16).Ç
Input: RSBits,RSParity,RSStop,Speedsettocorrectvalues.
Speedvaluesare:0=110baud,
1=600baud,
2=1200baud,
3=2400baud,
4=4800baud,
5=9600baud,
6=1200/75baud,
7=300baud.
Output: None.
UseinsteadoftheGEMDOSsetuproutine.
ü5:Storetheonlinescreenandenterbackgroundmode(Offset20).Ç
Input: None.
Output: None.
Theonlinescreenisstoredinaspecialbufferandanynewincoming
charactersfromtheRS232aredealtwithinthebackground.
ü6:Re-displaytheonlinescreenandenterforegroundmode(Offset24).Ç
Input: None.
Output: None.
Afterthiscallitistheprogram'sresponsibilitytodealwithanyincoming
characters.Thescreenisrestoredcompletelytothestateitwasinbefore
itwaslaststored.
ü7:Erasecursor(Offset28).Ç
Input: None.
Output: None.
Ensuresthatthecursorhasbeenremovedfromthescreen.Callthisroutine
afterresettingthe'CursorEnable'bitinthecursorflags.
Ensurethatthe'Lock'bitinthecursorflagsissetbeforecallingthis
routine.
÷ü8:DisplayCursor(Offset32).Ç
Input: None.
Output: None.
Placesthecursoronthescreenimmediately.
Ensurethatthe'Lock'bitinthecursorflagsissetbeforecallingthis
routine.
ü9:Movecursor(Offset36).Ç
Input: None.
Output: None.
Erasesthecursorfromitscurrentposition,andplacesitattheposition
definedbythecursorXandYpositioninthesystemvariables.
Thisroutineshouldnotnormallybeneeded,butifitisused,ensurethatthe
'Lock'bitinthecursorflagsisset.
ü10:Pointtonextcharactercell(Offset40).Ç
Input: None.
Output: None.
Performsacursorright,wrappingifnecessarybutnotupdatingthecursor.
ü11:Storecharacterincurrentposition(Offset44).Ç
Input: D0.B=Charactertostore.
Output: None.
Storesacharacterinthecurrentcell,andupdatestheDoubleHeightlistif
necessary.
ü12:Actuponacontrolcode(Offset48).Ç
Input: D0.B=Controlcode.
Output: None.
Thecursormayneedupdatingafterthisroutine.
ü13:Findoutwhatcolourthecurrentcharacteris(Offset52).
Ç
Input: None.
Output: None.
Updatesthecoloursandflagstoberelevanttothecurrentcell.
Useafteralteringthecursorposition.
÷ü14:Enablethemouse(Offset56).Ç
Input: D0.B=0,PlaceonthescreennextVblank,
=1,Placeonthescreenwhenitisnextmoved.
Output: None.
UseinsteadoftheA-Lineroutine.IfaDisableMousecallisencountered
beforethenextVblank,themousewillnotappear.
ü15:Disablethemouse(Offset60).Ç
Input: None.
Output: None.
UseinsteadoftheA-Lineroutine.Thisremovesthemousefromthescreen
immediately,andstopsitfrombeingredrawn.
ü16:Loadandrelocateamodule(Offset64).
Ç
Input: A0.L=Addressoffilename(nullterminated).
A6.L=Wheretoplacethefile.
Output: A6.L=Theendofthefile.
A5.L=TheoldvalueofA6(beginningofthefile).
UseinsteadoftheGEMrouine.Thisdoesnotcreateabasepage,andmodules
maybeplacedanywhereinmemory.A6isNOTrange-checked.
ü17:Getakeyfromthekeyboard(Offset68).Ç
Input: None.
Output: D0.W=Keypressed.IfD0.W=0thennokeywaspressed.
HighwordofD0isshift-keystatusasreturnedbyBIOS11.
ThisroutinetranslateskeyssuchasEnter,£and#toreturntheequivalent
viewdatacode.
ü18:Getastringfromthekeyboard(Offset72).Ç
Input: A0.L=Addressofbuffer.
D2.W=Maximumlengthofbuffer.
Output: Bufferfilledwithinputstring,D1.W=Lengthofstring.
D0=0,OK.D0=1,Rightmousebuttonpressed.
D3=Keywhichcausedreturn.
Thecursorwollbedisabledaftercallingthisroutine.Duringexecutionthe
cursorisenabled.Thebuffershouldbeinitialisedbeforecallingtoeither
nullsorspaces(theroutinewillreturnastringinthesameformatasitis
sent-SpacefilledorNullterminated).Ifthebuffercontainscharacters
thesewillbedisplayedandthecursorpositionedafterthelastnon-space.
≈ü19:Allocateamemoryblock(Offset76).Ç
Input: A0.L=Addressofstandardformatblocktoputintothesystem.
Output: IfD0.W=0thentheblockwasallocatedproperly-A1pointstoit.
IfD0.W=1thenablockwiththatnameandIDalreadyexists-A0
pointstoit.
IfD0.W=2thentherewasnotenoughmemory.
ü20:Removeamemoryblock(Offset80).Ç
Input: A0.L=Addressofstandardformatblockheader.
Output: IfD0.W=0thentheblockwasremovedsuccessfully.
IfD0.W=1thentheblockdidnotexist.
ü21:Findamemoryblock(Offset84).Ç
Input: A0.L=Addressofstandardformatblockheader.
Output: A0.L=Addressofblockiffound.
IfD0.W=0thentheblockwasfound.
IfD0.W=1thentheblockdidnotexist.
Usethistosearchforindefinitefiles.Tofacilitatethistheblockname
maycontainthewildcards'?'and'*',andiftheblocktypeissetto$FFFF
thenanyblockwiththatnamewillbefound.
ü22:Findthenextmemoryblock(Offset88).Ç
Input: D1andA0/A1from'FindBlock'.
Output: Asfor'FindBlock'.
ü23:Refreshthecurrentscreen(Offset92).Ç
Input: D0.B=0,don'tclearthescreenfirst.
<>0,clearthescreenfirst.
A0.L=Addressofbuffer.
Output: None.
Usethistorefreshthescreenafterithasbecomecorrupted(perhapsbythe
fileselector).
ü24:Clearthestatuslineandpointtoit(Offset96).Ç
Input: None.
Output: None.
Thisfunctionisintendedforusebyprogramswhichdisplayerrorsorrequest
input.Itdoesnotstorethecoloursandshouldbeusedwithcare.
εü25:Displayfileselectorandfetchafilename(Offset100).Ç
Input: A0.L=Addressoffilenamebuffer.
A1.L=Addressofheadingstring.
A2.L=Filetosearchfor(blockifsearchingRAM).
A3.L=Defaultpath(Diskonly).
D0.W=Lengthoffilename.
D1.B=0,RAMor1,Disk.
Output: A0.L=Filenamepaddedwithspaces.
A1.L=Fullpathnameoffile(zeroterminated).
D0.W=0,OK.
<>0,Error.
ThisfunctionshouldbeusedinsteadoftheGEMfileselector.Itis
recommendedthatthefullpathnamereturnedisusedfordiskfiles(thisis
notinitialisedforRAMfiles).
ü26:Dialanumber(Offser104).Ç
Input: A0.L=Telephonenumber(zeroterminated).
A1.L=Dialcommandstring.
D0.B=Dialtype:0-None.
1-RTSandDTR.
2-Smart,usingdialcommand.
Output: None.
ThisfunctioncausestheModemtopickupthelineanddial.IfD0=0thenthe
routinejustreturns.ThenumberisanASCIIstring,whichmaycontaincommas
andspaces.'^'isusedtodenotecontrolcodesinthedialcommand-'^M'is
Return.
ü27:Usepredefinedcolourmacro(Offset108).Ç
Input: D0.W=Functionkeynumber(1..10).
D1.W=Shiftkeystatus-bit0=Shift.
1=Ctrl.
2=Alt.
Output: None.
Thisfunctionisusedtoimplementthepredefinedcolourmacros.Theshift
keyandfunctionkeyvaluesmaybederivedfromthevaluesreturnedfrom
Function17(GetKey).
⌠ü28:Monitorinteractionwiththetopline(Offset116).Ç
Input: A0.L=ToplineArrayaddress.
Output: D0.W=PDMnumberselected(0..n).
D1.W=OptionnumberwithinPDM(0..n).
Usethisfunctiontoimplementpull-downmenus.Ifduringtheexecutionofa
programitfindsbit2ofScreenFlagsissetthisroutineshouldbecalled,
andthebitreset.IfD0.Wisnegativethennothingwasselected,andD1is
meaningless.
ü29:RaiseDTRandRTS(Offset120).Ç
Input: None.
Output: None.
ThisisusedtotellaModemthatyouareabouttogoonline,andwithsome
Modemsitwillactuallypickuptheline.Usebeforedialling.
ü30:DropDTRandRTSifnoDCDÇü(Offset124).Ç
Input: None.
Output: None.
Usethisroutineonexitfromaterminalemulator.Ifthereisnocarrierthe
linewillbedropped.
#ü31:EnterResponseFramehandler(Offset128).Ç
Input: A0.L=AddressofblankResponseFrame.
A1.L=AddressofControlArray.
A2.L=Addressofauto-execroutineor0.
A3.L=Defaultfields.
D7.B=Bitsignificanterrorhandlerflags
Output: D0.W=0,OK.
<>0,Cancel.
D3.W=Mousebuttonthatcausedexit(1..n).
Ifa'Cancel'buttonispressedtoexittheDefaultFieldsarepreserved,
otherwisetheyarechangedtoreflectwhattheuserentered.ThevalueinD3
maybeusedtoimplementspecialroutinessuchas'NextFrame'buttons.
Theerrorhandlerflagsaretestedwhenan'E'fieldisfound.Thefirst'E'
fieldisbit0,thesecondisbit1,etc.Youmayonlyhave8'E'fieldsin
anyoneframe.
∩ü32:FieldConversion(Offset132).Ç
Input: D1.W=Lengthoffield.
D0.B=Conversiontype:
0:ConvertASCIInumberin(A0)to(A1)addingleadingzeros.
1:ConvertASCIInumberin(A0)to(A1)removingleadingzeros.
2:ConvertASCIInumberin(A0)toD0.L.
3:Copy(A0)to(A1)removingtrailingnull.
4:Copy(A0)to(A1)addingnullatendofstring.
5:ConvertLongwordat(A0)toASCIIat(A1).
Output: Seeabove.
Thisisusefulforconvertingoutputfromresponseframes(whichisalways
spacefilledASCII)tointernalrepresentationsofthedata.
ü33:RefreshTime&Datevalues(Offset136).Ç
Input: None.
Output: None.
CallthisroutinebeforereadingBCDTime&Datefromsystemvariables.
Ç**************************************************************************
* SYSRESET.S *
* *
* Written using Hisoft Devpac-2 *
* *
* Example VDT file, which adds the option to reset the system *
* This program is rather verbose in places...! *
* *
* Version 1.00 11th September 1989 *
* Added new VTOS calls - Version 1.01 27th May 1990 *
* *
**************************************************************************
opt o+ * Optimisation on
output .VDT * Override default .PRG
section text
* The CallVTOS macro is quite handy. Feel free to use it in your own
* programs.
CallVTOS: macro
clr.l -(sp) * Dummy argument
move.l a0,-(sp) * Store register
move.l VtosBase,a0 * Base of table
move.l \1*4(a0),4(sp) * Store jump
move.l (sp)+,a0 * Retrieve register
rts * Indirect jump to routine
endm
* This is where the program code starts. First we must define the
* VTOS header.
dc.w $abcd * This is a VTOS module
dc.l Setup * Initialisation
dc.l ResetMenu * Menu option
dc.l 0 * No chain
* Note the above value may be altered. To put more than one module in
* a single file use the 'chain' value to define where the next header
* is.
* Initialisation - Must not alter registers a0-a5 or d0-d7
Setup: movem.l a0-a5/d0-d7,-(sp)
move.l a0,VtosBase * VTOS base address
move.l a1,VtosBss * VTOS BSS address
move.l a1,a6 * Set base pointer
* Put your initialisation here!
* A6 is not altered by any VTOS routines, and by convention points to the
* VTOS BSS address. Alter this at your peril!
movem.l (sp)+,a0-a5/d0-d7
rts
Ç
Reset: move.b $26(a6),d0 * Fetch mouse button status
and.b #$fc,d0 * Wait for mouse to be stopped
bne Reset * Wait for it...!
* The next bit is a pretty standard system-reset routine
* The purpose of waiting for both mouse buttons to be lifted is because
* the IKBD controller gets confused if you hold down a mouse button during
* a system reset.
clr.l -(sp) * SSP=USP
move.w #$20,-(sp) * Supervisor/User mode toggle
trap #1
move.l $4f2,a0 * System reset PC address
move.l (a0),-(sp) * Fetch reset value
rts * Jump into it!
* Although not used by this program, VTOS calls are defined as follows.
* See VTOS technical manual for further details on each routine
PrintCharacter: CallVTOS 0
DisplayChar: CallVTOS 1
RxCharacter: CallVTOS 2
TxCharacter: CallVTOS 3
ConfigRS232: CallVTOS 4
GotoBackground: CallVTOS 5
GotoOnline: CallVTOS 6
EraseCursor: CallVTOS 7
DisplayCursor: CallVTOS 8
MoveCursor: CallVTOS 9
StepToNext: CallVTOS 10
StoreCharacter: CallVTOS 11
ControlAction: CallVTOS 12
GetColour: CallVTOS 13
MouseOn: CallVTOS 14
MouseOff: CallVTOS 15
LoadRelocate: CallVTOS 16
GetKey: CallVTOS 17
GetString: CallVTOS 18
AllocateBlock: CallVTOS 19
RemoveBlock: CallVTOS 20
FindBlock: CallVTOS 21
FindNext: CallVTOS 22
RfshScreen: CallVTOS 23
ClearBottom: CallVTOS 24
FileSelector: CallVTOS 25
DialComputer: CallVTOS 26
UseColour: CallVTOS 27
UseTopLine: CallVTOS 28
RaiseDTR: CallVTOS 29
DropDTR: CallVTOS 30
DoResponse: CallVTOS 31
ConvertField: CallVTOS 32
FetchTime: CallVTOS 33
RapidDisplay: CallVTOS 34
ÇReadCookie: CallVTOS 35
WriteCookie: CallVTOS 36
section data
* The menus are defined here
ResetMenu: dc.b 1,'Reset System ' * Enabled, goes to menu
dc.l ResetSubMenu * Address of menu
ResetSubMenu: dc.w 1 * Just one option
dc.l ResetSubTitle * Title string
dc.l ResetSubOpt1 * Option 1
ResetSubTitle: dc.b 'Reset system',0 * Title string
even
* Note the line below is the same format as 'ResetMenu'
* Remember each option string must be of an odd length.
ResetSubOpt1: dc.b 3,'Yes Please ' * Enabled, executes
dc.l Reset * Routine address
section bss
VtosBase: ds.l 1 * VTOS jump-table address
VtosBss: ds.l 1 * VTOS system variables
Ç